﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ManagementToolClient.BaseViewModels
{
    public class InstanceBase<T>
           where T : new()
    {
        private static T instance;
        public static T Instance
        {
            get
            {
                if (InstanceBase<T>.instance == null)
                {
                    InstanceBase<T>.instance = Activator.CreateInstance<T>();
                }
                return InstanceBase<T>.instance;
            }

            set
            {
                InstanceBase<T>.instance = value;
            }
        }

        public InstanceBase()
        {

        }

    }
}
